package com.itheima.mystream;

import java.util.ArrayList;
import java.util.List;

public class Demo1 {
    public static void main(String[] args) {
    //创建一个集合，存储多个字符串元素
    ArrayList<String> list = new ArrayList<String>(List.of("林青霞","张曼玉","王祖贤","柳岩","张敏","张无忌"));

    //Stream流来改进
    list.stream().filter(s -> s.startsWith("张")).filter(s -> s.length() == 3).forEach(s -> System.out.println(s));
    }
}
